<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${initProjectVo.packageName}.mapper.RoleUserMapper">
      <select id="selectEntityList" resultType="${initProjectVo.packageName}.dto.RoleUserDTO">
               SELECT
	t1.user_real_name,t2.id,t3.role_name
FROM
	t_user t1,
	t_sys_user_role t2,
	t_sys_role t3
WHERE
	t1.id = t2.user_id
	AND t2.role_id = t3.id
        </select>

	<select id="selectUserRole" resultType="java.lang.String">
		SELECT
		t3.id
		FROM
		t_sys_user_role t1,
		t_sys_role_permission t2,
		t_sys_permission t3
		WHERE
		t1.role_id = t2.role_id
		AND t2.permission_id = t3.id
		and t1.user_id = #{userId}

	</select>
</mapper>